<template>
	<view>
		<u-navbar :autoBack="true" leftIconColor="white" title="业绩明细" :placeholder="true" bgColor="#3ACD90"  :titleStyle="{ color: '#FFFFFF', fontSize: '40rpx' }"></u-navbar>

		<view class="tagtitle ">
			<view class="fbold" style="display: flex; justify-content: space-around;">
				<view class="fbold ft40" @click="selectItem('personal')"
					:style="{ color: selected === 'personal' ? '#3ACD90' : '#7D7D7D' }">个人业绩</view>
			</view>
			<view class="vertical-divider" style="margin-top: 30rpx;"></view>

			<view >
				<DaDropdownVue2

				    :dropdownMenu="dropdownMenuList"
				    themeColor="#3ACD90"
				    textColor="black"
				    :duration="300"

				    @confirm="handleConfirm"
				    @close="handleClose"
				    @open="handleOpen">
				    
				  </DaDropdownVue2>
			</view>

		</view>

		<yeji  :date="yejidate"></yeji>
	</view>

</template>

<script>
import DaDropdownVue2 from '@/components/da-dropdown-vue2/index.vue'
import yeji from '@/components/yeji.vue'
import dayjs from 'dayjs';
let currentTime = dayjs().format('YYYY/MM/DD')
export default {
	components: {
		DaDropdownVue2,
		yeji
	},
	data() {
		return {
			selected: "team",
			// 简单示例
			dropdownMenuList:[
			  {
			      title: '筛选日期',
			      type: 'daterange',
			      prop: 'god1',
			      value: { start: currentTime, end: currentTime },
			    },
			],
			starttime:currentTime,
			endtime:currentTime,
			yejidate:''
		}
	},
	onLoad() {
		this.yejidate = currentTime + "-" + currentTime
	},
	methods: {
		selectItem(item) {
			this.selected = item; // 更新选中的项
		},
		handleConfirm(v) {
		  console.log('handleConfirm ==>', v)
		  let result = v.god1
		  this.starttime = result.start
		  let date = result.start.replace(/-/g, '/') + '-'+ result.end.replace(/-/g, '/')
		  this.yejidate = date
		  // this.getDataDetail(date);
		},
		handleClose(v) {
		  console.log('handleClose ==>', v)
		},
		handleOpen(v) {
		  console.log('handleOpen ==>', v)
		},
	}
}
</script>

<style scoped>
	/deep/ .uni-nav-bar-text{
		font-size: 42rpx !important;
		font-weight: bold;
	}
	.tagtitle {
		background-color: #ffffff;
		padding: 20rpx;

	}

	/deep/ .uniui-bottom {
		color: black !important
	}

	.vertical-divider {
		width: 100%;
		height: 2rpx;
		background-color: #ccc;

	}
	/deep/ .da-dropdown-menu{
		box-shadow: 0 0 0 0!important;
	}
	/deep/ .da-dropdown-filter--title{
		padding: 6rpx 0rpx !important;
	}
	/deep/ .da-dropdown-menu-item--text{
		font-size:30rpx !important
	}
	
	.center-second{
		margin-top: 20rpx;
		background-color: #ffffff;
		border-radius: 20rpx;
		padding-bottom: 40rpx;
	}
</style>